//
//  CalculatorButtonRow.swift
//  Calculator
//
//  Created by zhaoke on 2023/6/10.
//

import Foundation
import SwiftUI

struct CalculatorButtonRow: View {
    //
    let row: [CalculatorButtonItem]
    @EnvironmentObject var model: CalculatorModel
    //
    var body: some View {
        HStack {
            ForEach(row, id: \.self) {  item in
                CalculatorButton(
                    title: item.title,
                    size: item.size,
                    backgroundColor: item.backgroundColor)
                {
                    self.model.apply(item)
                }
            }
        }
    }
}
